<template>
    <div>
        <div style="margin: 10px 0; ">
            <el-input  placeholder="请输入学号" style="width: 400px;" suffix-icon="el-icon-search
    " v-model="studentId">
        </el-input ><el-button  class="ml-5" type="primary" @click="load" icon="el-icon-search">搜索</el-button>
        <el-button  class="ml-5" type="primary" @click="reset" icon="el-icon-refresh" >重置</el-button>
        <el-button  class="ml-5" type="primary" @click="show" icon="el-icon-position" >研一</el-button>
        <el-button  class="ml-5" type="primary" @click="show1" icon="el-icon-position" >研二</el-button>
        <el-button  class="ml-5" type="primary" @click="show2" icon="el-icon-position" >研三</el-button>
        </div>
    
        <el-table :data="tableData"  stripe :header-cell-class-name="headerBg" border @selection-change="handleSelectionChange">
         
          <el-table-column prop="studentId" label="学号" width="200">
            </el-table-column>
            <el-table-column prop="name" label="姓名" width="200">
            </el-table-column>
            <el-table-column prop="scho" label="奖项" width="100">
            </el-table-column>
            <el-table-column prop="scholarshipS" label="奖金" width="150">
            </el-table-column>
            <el-table-column prop="score" label="加权成绩" width="150">
            </el-table-column>


        </el-table>
        <div class="block" style="padding: 10px;">
        
        <el-pagination
          @size-change="handleSizeChange"
          @current-change="handleCurrentChange"
          :current-page="pageNum"
          :page-sizes="[5, 10, 15, 20]"
          :page-size="pageSize"
          layout="total, sizes, prev, pager, next, jumper"
          :total="total">
        </el-pagination>
      </div>
      <!-- 弹窗 -->
     
      
    </div>
    </template>
    
    
    <script>
    
    import request from '../utils/request';
    
    
    
    export default{
        name: 'Suser',
        data(){
          
      return{
        tableData:[],
        total: 0,
        pageNum:1,
        pageSize: 5,
        studentId:'',
        grade:'',
        headerBg:'headerBg',
        multipleSelection: [],
        bohui:{},
        student:{

        },
        rule:{

        },
        scoringDetailsVisible: false,
        form:{
          studentId: '',
          name: '',
          enrollmentYear: '',
          department: '',
          grade: '',
          contactInfo: '',
    
        }
      }
      },
      created(){
        this.load()
      },
      methods: {
      load(){
        request.get("/scholarship/finish",{
          params:{
            pageNum : this.pageNum,
            pageSize: this.pageSize,
            studentId: this.studentId,
            grade: this.grade
          }
        }).then(res => {
          console.log(res)
          this.tableData = res.data.records
          this.total = res.data.total
        })
      },
      handleSizeChange(pageSize) {
        console.log(pageSize)
        this.pageSize = pageSize
        this.load()
       
      },
      handleCurrentChange(pageNum) {
        console.log(pageNum)
        this.pageNum = pageNum
       this.load()
      },
      
      // 重置按钮
      reset(){
        this.studentId=''
        this.grade=''
        this.load()
      },
      show(){
        this.grade='研一'
        this.load()
      },
      show1(){
        this.grade='研二'
        this.load()
      },
      show1(){
        this.grade='研二'
        this.load()
      },
      show2(){
        this.grade='研三'
        this.load()
      },
    
     
      handleSelectionChange(val){
        this.multipleSelection = val
      },

     

     }
    }
     
    </script>
    
    <style scoped>
    .headerBg{
      background-color: #bcb7b7!important;
    }
    </style>